package com.example.todolist.dto;

import lombok.*;

@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
public final class TodoIndexParameter {
    private int index;


    public static TodoIndexParameter of(final int index) {
        if (index <= 0) {
            throw new IllegalArgumentException("Todo index should be greater than 0");
        }

        return new TodoIndexParameter(index);
    }
}
